package day_06;


import java.util.ArrayList;

/**
 * @ClassName MathTools
 * @Description TODO
 * @Author hp
 * @Date 2021/6/8 9:38
 * @Version 1.0
 **/
public class MathTools {
    public  static int comperTo(int a,int b){
        return a>b?a:b;
    }
    public  static boolean primeNumber(int x){
        boolean flag = true;
        for (int i = 2; i < x; i++) {
            if(x%i==0){
                flag = false;
            }
        }
        return  flag;
    }
    public static Object[] approximateNum(int x){

        ArrayList<Integer> ints = new ArrayList<Integer>();
        for(int i=1;i<=x;i++){
            if (x%i==0){
                ints.add(i);
            }
        }
        return ints.toArray();
    }
}
